<?php
/**
 * Created by PhpStorm.
 * User: ownfi
 * Date: 2017-04-08
 * Time: 10:16
 */

namespace App\Services;

use App\Models\MasterFund;

/**
 * 支付服务
 * Interface IPayService
 * @package App\Services
 */
interface IPayService
{

    /**
     * 设定支付组件
     * @param $payment_method Params::$PAY_METHOD
     * @return mixed
     */
    public function setPaymentMethod($payment_method);

    /**
     * 生成诚信保证金表单
     * @param $master_id
     * @param $amount
     * @param $pay_method Params::$PAY_METHOD
     * @return mixed
     */
    public function assureFundOrderForm($master_id,$amount,$redirect_url);

    /**
     * 记录日志
     * @param $message
     * @return mixed
     */
    public function log($message);

    /**
     * 接收&回应支付回调，设置交易成功的订单状态
     * @param $trade_number
     * @return mixed
     */
    public function handleNotify();

    /**
     * 根据师傅交易记录流水号检查交易是否已成功
     * @param $order_number
     * @return mixed
     */
    public function checkPaymentSuccess($trade_number);

    /**
     * 处理交易成功的流水，设置对应订单状态
     * @param $trade_number
     * @return mixed
     */
    public function handlePaymentSuccess($trade_number);

}